package com.kaiwukj.android.ufamily.mvp.ui.page.service.gm;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.kaiwukj.android.ufamily.R;
import com.kaiwukj.android.ufamily.mvp.http.entity.helper.GMProjectMemberResult;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

public class GMProjectMemberAdapter extends BaseQuickAdapter<GMProjectMemberResult, BaseViewHolder> {
    public GMProjectMemberAdapter(@Nullable List<GMProjectMemberResult> data) {
        super(R.layout.item_gm_order_detail_project_member, data);
        addChildClickViewIds(R.id.iv_call);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, GMProjectMemberResult gmProjectMemberResult) {
        holder.setText(R.id.tv_name, gmProjectMemberResult.getName());
        holder.setText(R.id.tv_desc, gmProjectMemberResult.getDesc());

        Glide.with(getContext())
                .load(gmProjectMemberResult.getAvatar())
                .placeholder(R.mipmap.icon_avatar_default_v4)
                .into((ImageView) holder.getView(R.id.iv_avatar));
    }
}
